void LCD_IC_Init(void)
{
#include "delay.h"
	//ILI9163C,FOR LB1.41
	
	WriteComm(0x11); //Exit Sleep
	Delay(50);
	
	WriteComm(0x26); //Set Default Gamma
	WriteData(0x04);
	
	WriteComm(0xB1);//Set Frame Rate
	WriteData(0x0C);
	WriteData(0x14);
	
	WriteComm(0xC0); //Set VRH1[4:0] & VC[2:0] for VCI1 & GVDD
	WriteData(0x0C);
	WriteData(0x05);
	
	WriteComm(0xC1); //Set BT[2:0] for AVDD & VCL & VGH & VGL
	WriteData(0x02);//0x00
	
	WriteComm(0xC5); //Set VMH[6:0] & VML[6:0] for VOMH & VCOML
	WriteData(0x29);  //31  21  29
	WriteData(0x43);  //58   48  43
	
	WriteComm(0xC7);
	WriteData(0x40);
	
	WriteComm(0x3a); //Set Color Format
	WriteData(0x05);
	
	WriteComm(0x2A); //Set Column Address
	WriteData(0x00);
	WriteData(0x00);
	WriteData(0x00);
	WriteData(0x7F);
	
	WriteComm(0x2B); //Set Page Address
	WriteData(0x00);
	WriteData(0x00);
	WriteData(0x00);
	WriteData(0x9F);
	
	WriteComm(0x36); //Set Scanning Direction
	WriteData(0xC8); //0xc8
	
	WriteComm(0xB7); //Set Source Output Direction
	WriteData(0x00);
	
	WriteComm(0xF2); //Enable Gamma bit
	WriteData(0x01);
	
	WriteComm(0xE0);
	WriteData(0x36);//p1
	WriteData(0x29);//p2
	WriteData(0x12);//p3
	WriteData(0x22);//p4
	WriteData(0x1C);//p5
	WriteData(0x15);//p6
	WriteData(0x42);//p7
	WriteData(0xB7);//p8
	WriteData(0x2F);//p9
	WriteData(0x13);//p10
	WriteData(0x12);//p11
	WriteData(0x0A);//p12
	WriteData(0x11);//p13
	WriteData(0x0B);//p14
	WriteData(0x06);//p15
	
	
	WriteComm(0xE1);
	WriteData(0x09);//p1
	WriteData(0x16);//p2
	WriteData(0x2D);//p3
	WriteData(0x0D);//p4
	WriteData(0x13);//p5
	WriteData(0x15);//p6
	WriteData(0x40);//p7
	WriteData(0x48);//p8
	WriteData(0x53);//p9
	WriteData(0x0C);//p10
	WriteData(0x1D);//p11
	WriteData(0x25);//p12
	WriteData(0x2E);//p13
	WriteData(0x34);//p14
	WriteData(0x39);//p15

	WriteComm(0x29); // Display On
	
	WriteComm(0x2c);


}
